<%@ page contentType="text/html;charset=UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ include file="header.jsp" %>

<h1>搜索结果："${searchKeyword}"</h1>

<c:if test="${empty blogs}">
    <p>没有找到相关博客</p>
</c:if>

<c:forEach items="${blogs}" var="blog">
    <div class="blog-item">
        <h3>
            <a href="${pageContext.request.contextPath}/blog/detail?id=${blog.id}">
                ${blog.title}
            </a>
        </h3>
        <p>${blog.content.substring(0, 100)}...</p>
        <small>作者: ${blog.authorName}</small>
    </div>
</c:forEach>

<%@ include file="footer.jsp" %>